<html>
<head><meta charset="utf-8"><title>env vars and x.py #38686 · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/env.20vars.20and.20x.2Epy.20.2338686.html">env vars and x.py #38686</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="177367557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/env%20vars%20and%20x.py%20%2338686/near/177367557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/env.20vars.20and.20x.2Epy.20.2338686.html#177367557">(Oct 04 2019 at 18:40)</a>:</h4>
<p>Argh it drives me crazy when I get messages like this:</p>
<div class="codehilite"><pre><span></span>thread &#39;main&#39; panicked at &#39;RUSTC_STAGE was not set: NotPresent&#39;, src/libcore/result.rs:1165:5
</pre></div>


<p>is there some easy way to get access to all the env variables?</p>



<a name="177368096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/env%20vars%20and%20x.py%20%2338686/near/177368096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/env.20vars.20and.20x.2Epy.20.2338686.html#177368096">(Oct 04 2019 at 18:46)</a>:</h4>
<p>would be good to know this</p>



<a name="177368120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/env%20vars%20and%20x.py%20%2338686/near/177368120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/env.20vars.20and.20x.2Epy.20.2338686.html#177368120">(Oct 04 2019 at 18:46)</a>:</h4>
<p>last time I just added a bunch of <code>println!</code>s around here <a href="https://github.com/rust-lang/rust/blob/2e7244807a7878f6eca3eb7d97ae9b413aa49014/src/bootstrap/builder.rs#L912" target="_blank" title="https://github.com/rust-lang/rust/blob/2e7244807a7878f6eca3eb7d97ae9b413aa49014/src/bootstrap/builder.rs#L912">https://github.com/rust-lang/rust/blob/2e7244807a7878f6eca3eb7d97ae9b413aa49014/src/bootstrap/builder.rs#L912</a></p>



<a name="177498336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/env%20vars%20and%20x.py%20%2338686/near/177498336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/env.20vars.20and.20x.2Epy.20.2338686.html#177498336">(Oct 07 2019 at 08:05)</a>:</h4>
<p>there's an issue where nagisa recommended a more general observation mechanism, let me find it</p>



<a name="177498401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/env%20vars%20and%20x.py%20%2338686/near/177498401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/env.20vars.20and.20x.2Epy.20.2338686.html#177498401">(Oct 07 2019 at 08:06)</a>:</h4>
<p><code>x.py --on-fail</code> is what we've talked about in the past</p>



<a name="177498524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/env%20vars%20and%20x.py%20%2338686/near/177498524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/env.20vars.20and.20x.2Epy.20.2338686.html#177498524">(Oct 07 2019 at 08:08)</a>:</h4>
<p>so the ancient issue about this is <a href="https://github.com/rust-lang/rust/issues/38686" target="_blank" title="https://github.com/rust-lang/rust/issues/38686">#38686</a></p>



<a name="177498536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/env%20vars%20and%20x.py%20%2338686/near/177498536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/env.20vars.20and.20x.2Epy.20.2338686.html#177498536">(Oct 07 2019 at 08:08)</a>:</h4>
<p>and nagisa addressed it via PR <a href="https://github.com/rust-lang/rust/issues/39888" target="_blank" title="https://github.com/rust-lang/rust/issues/39888">#39888</a></p>



<a name="177498566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/env%20vars%20and%20x.py%20%2338686/near/177498566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/env.20vars.20and.20x.2Epy.20.2338686.html#177498566">(Oct 07 2019 at 08:09)</a>:</h4>
<p>but using that with <code>bash</code> stopped working sometime in 2017/2018, as documented in <a href="https://github.com/rust-lang/rust/issues/47645" target="_blank" title="https://github.com/rust-lang/rust/issues/47645">#47645</a>; but you can still use <code>x.py --on-fail=print-env</code> instead of trying to do <code>x.py --on-fail=bash</code>.</p>



<a name="177498644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/env%20vars%20and%20x.py%20%2338686/near/177498644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/env.20vars.20and.20x.2Epy.20.2338686.html#177498644">(Oct 07 2019 at 08:11)</a>:</h4>
<p>I'm going to reopen <a href="https://github.com/rust-lang/rust/issues/38686" target="_blank" title="https://github.com/rust-lang/rust/issues/38686">#38686</a>, based on the reasoning I presented in <a href="https://github.com/rust-lang/rust/issues/38686#issuecomment-360820555" target="_blank" title="https://github.com/rust-lang/rust/issues/38686#issuecomment-360820555">my comment there</a></p>



<a name="177498735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/env%20vars%20and%20x.py%20%2338686/near/177498735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/env.20vars.20and.20x.2Epy.20.2338686.html#177498735">(Oct 07 2019 at 08:12)</a>:</h4>
<p>still, you all should be able to use <code>x.py --on-fail=print-env</code> to address the case where the <code>rustc</code> invocation is ICE'ing (I think)</p>



<a name="177512339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/env%20vars%20and%20x.py%20%2338686/near/177512339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/env.20vars.20and.20x.2Epy.20.2338686.html#177512339">(Oct 07 2019 at 12:01)</a>:</h4>
<p>I would be OK with dropping <code>--on-fail</code> if we end up adding the necessary additions to <code>--verbose</code> output</p>



<a name="177512409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/env%20vars%20and%20x.py%20%2338686/near/177512409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/env.20vars.20and.20x.2Epy.20.2338686.html#177512409">(Oct 07 2019 at 12:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> in general I find that replacing <code>./build/bin/rustc</code> with <code>./build/&lt;target&gt;/stageN/bin/rustc</code> just works, that one is a plain rust executable, not a wrapper.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>